package com.example.yunbiji0314.util;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {
    @ApiModelProperty(value = "状态码",required = true)
    private Integer code; //状态码 代表请求成功还是失败
    @ApiModelProperty(value = "数据",required = true)
    private Object data;  //数据，请求成功携带的数据 查询的时候这个data才会有数据
    @ApiModelProperty(value = "描述",required = true)
    private String msg;  //描述，请求失败的时候，会携带一个描述信息

    public Result() {
    }

    public  Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public  Result(Integer code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }
}
